#pragma once
#include<vector>
#include "protocol/context/ParseContext.h"
#include "protocol/expressions/IExpression.h"
namespace protocol::expressions {
	class SubCommandExpression :public protocol::expressions::IExpression {
    public:
    void Serialize(protocol::context::ParseContext& context) override {
        uint8_t subcmd = context.getMsgNode().logical_body_.subCommand;
        context.appendSerializedBytes(subcmd);
    }
    bool Deserialize(protocol::context::ParseContext& context, const std::vector<uint8_t>& data) override {
        auto cur = context.getByteOffset();
        context.getMsgNode().logical_body_.subCommand = data[cur++];
        context.setByteOffset(cur);
        return true;
    }
    
    };
}
